package service.impl;

import dao.NoticeDao;
import entity.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.NoticeService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("noticeService")
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private NoticeDao noticeDao;

    @Override
    public List<Notice> query(String notTitle, String startTime, String endTime, int pageSize, int pageNumber) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("notTitle",notTitle);
        map.put("startTime",startTime);
        map.put("endTime",endTime);
        map.put("offset",(pageNumber-1)*pageSize);
        map.put("limit",pageSize);
        return noticeDao.query(map);
    }
}
